<template>
	<div>
		<div
			class="js-copy js-content pd_body"
			:class="{ pd_body_stocks: judgeStocksPath() || judgeStablecoinPath() }"
		>
			<headerNav :currentPath="'dataera'" :isScrolled="isScrolled"></headerNav>
			<headerTop
				v-if="judgeBtcPath()"
				class="headertop"
				:type="'2'"
				:language="this.$route.params.type"
			>
			</headerTop>
			<btc :type="this.$route.params.type" v-if="judgeBtcPath()"> </btc>
			<coinstock :type="this.$route.params.type" v-else-if="judgeStocksPath()">
			</coinstock>
			<stablecoin
				:type="this.$route.params.type"
				v-else-if="judgeStablecoinPath()"
			>
			</stablecoin>
		</div>
	</div>
</template>

<script>
import headerNav from "./headern.vue";
import btc from "./btc_org.vue";
import coinstock from "./coinstock.vue";
import stablecoin from "./stablecoin.vue";
import headerTop from "@/components/pc/headern.vue";
import { newBus } from "../../components/pc/headern";

export default {
	name: "",
	components: { headerNav, headerTop, btc, coinstock, stablecoin },
	data() {
		return {
			isMobileDevice: window.screen.width < 900,
			isScrolled: false,
			osafai: false,
			olead: false,
			type: "",
		};
	},
	created() {},

	mounted() {
		this.showSel = 0;
		const that = this;
		window.onresize = () => {
			return (() => {
				that.isMobileDevice = window.screen.width < 900;
			})();
		};

		this.type = this.$route.params.type;
		newBus.$on("global-notification", (data) => {
			let localLanguage = sessionStorage.getItem("localLanguage");

			if (localLanguage == "繁体中文") {
				this.localLanguage = 1;
			} else if (localLanguage == "english") {
				this.localLanguage = 2;
			} else {
				this.localLanguage = 0;
			}

			console.log("localLanguage" + localLanguage);
		});
	},
	methods: {
		judgeBtcPath() {
			return (
				this.$route.params.type != undefined &&
				this.$route.params.type.includes("btcstrategicreserve")
			);
		},
		judgeStablecoinPath() {
			return (
				this.$route.params.type != undefined &&
				this.$route.params.type.includes("stablecoin")
			);
		},
		judgeStocksPath() {
			return (
				this.$route.params.type == "" ||
				this.$route.params.type == undefined ||
				this.$route.params.type == null ||
				this.$route.params.type.includes("cryptostock")
			);
		},
	},
};
</script>

<style scoped>
.headertop {
	display: block;
}

.pd_body {
	height: 100vh;
	overflow-y: scroll;
}

.pd_body_stocks {
	background: #1b1b1b !important;
}

.scroll-container {
	height: 100vh;
	overflow-y: scroll;
}
.js-copy {
	position: absolute;
	top: 0px;
	left: 0;
	width: calc(100vw);
	margin: 0 auto;
	background: #f4f4f4;
}

@media screen and (max-width: 900px) {
	.js-copy {
		background: #0f0f0f;
	}
	.headertop {
		display: none;
	}
}
</style>

<style>
@media screen and (max-width: 900px) {
	.headerg.leftTab {
		display: block !important;
	}
}
</style>

<style>
.boxCon {
	padding-top: 0px;
}
</style>
